<?php
session_start();

include 'connect.php';

$email =$_POST['Email'];
$password =$_POST['Password'];

$query = mysql_query ("SELECT * FROM login
WHERE Email='$email' and Password='$password'");
$count =mysql_num_rows($query);

if ($count==TRUE)
  {
  
  session_register("Email");
  session_register("Password");
  header("location:index2.html?success");
  }
  else
echo "<script>alert('Wrong Email and Password!');
  javascript:history.go(-1);</script>";
?>